package net.xju_17_18.entity;

import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Data
@Component
public class Sch {
    @Value("321")
    private int id;

    @Autowired
    @Qualifier("stu")
    private Stu stu;

//    @PostConstruct
//    public void init() {
//        System.out.println("Bean初始化完成，调用init 方法");
//    }
    @PreDestroy
    public void destroy() {
        System.out.println("Bean即将销毁，调用destroy 方法");
    }

}
